package com.hnnu.shoppingtoghter.demo.service.impl;

import com.github.pagehelper.PageHelper;
import com.hnnu.shoppingtoghter.demo.entity.Message;
import com.hnnu.shoppingtoghter.demo.entity.Project;
import com.hnnu.shoppingtoghter.demo.mapper.MessageMapper;
import com.hnnu.shoppingtoghter.demo.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description:
 * @Author: liu_cheng_xi
 * @CreateTime： 2022/7/7 1:40
 */
@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    private MessageMapper messageMapper;

    /**
     * @param message
     * @Description: TODO
     * @Author: liu_cheng_xi
     * @CreateTime: 2022/7/7 1:43
     * @param: null
     * @return: null
     */
    @Override
    public List<Message> selectListByMessage(Message message) {
        PageHelper.startPage(message.getPage(),message.getRow());
        List<Message> messageList = messageMapper.selectListByMessage(message);
        return messageList;
    }

    /**
     * @param message
     * @Description: TODO
     * @Author: liu_cheng_xi
     * @CreateTime: 2022/7/8 13:59
     * @param: null
     * @return: null
     */
    @Override
    public int insertMessage(Message message) {
        return messageMapper.insertMessage(message);
    }
}
